/****************************************Copyright (c)**************************************************
**                                         2016-03
**
**                                
**
**
**--------------File Info-------------------------------------------------------------------------------
** File name:		    ht6x1x_exint.c
** Last modified Date:  2016-03-29
** Last Version:		v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Created by:			Evan Chen
** Created date:		2016-03-29
** Version:				v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "ht6x1x_exint.h"

void EXINT_Enable(EXT_EdgePins pin, EXT_EdgeType edge)
{
	HT_INT->EXTIF &= ~(pin <<  edge);
	HT_INT->EXTIE |= (pin <<  edge);
}


void EXINT_Disable(EXT_EdgePins pin, EXT_EdgeType edge)
{
	HT_INT->EXTIF &= ~(pin <<  edge);
	HT_INT->EXTIE &= ~(pin <<  edge);
}


void EXINT_ClearFlag(void)
{
	HT_INT->EXTIF = 0;
}


void EXINT_SetPinFilter(EXT_FilterPins pin, FunctionalState state)
{
	if(ENABLE == state) {HT_INT->PINFLT |= pin;}
	else {HT_INT->PINFLT &= ~pin;}
}

